<%-- 
    Document   : index
    Created on : 02-oct-2008, 19:04:51
    Author     : victor
--%>

<%@page contentType="text/html" pageEncoding="ISO-8859-1" import="java.util.*" import="com.util.*" import="com.debug.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<table>
    <tr><td>&nbsp;</td></tr>
    <tr>
        <%
        int pagActual=Integer.parseInt((String)request.getAttribute("pagActual"));
        int numPagTotal=Integer.parseInt((String)request.getAttribute("numPagTotal"));
        
        
        for(int i=0;i<numPagTotal;i++){
            if((i+1)==pagActual){
                out.print("<td>"+(i+1)+"</td>");
            }else{
                out.print("<td><a href='log_index.do?pagActual="+(i+1)+"'>"+(i+1)+"</a></td>");
            }
        }
        
        %>
        
    </tr>
</table>

<table>
    <tr><td>&nbsp;</td></tr>
    <tr class="cabecera">
        <td>IP</td><td>Fecha</td><td>URL</td><td>Texto</td>
    </tr>
<%
            ArrayList miLista = (ArrayList) request.getAttribute("lista");
            
            
            EntradaDebug log;
            String estilo;
            String color;
            for (int i = 0; i < miLista.size(); i++) {
                log = (EntradaDebug) miLista.get(i);
                if (i % 2 == 0) {
                    estilo = "lista1";
                    color = "#ffffff";

                } else {
                    estilo = "lista2";
                    color = "#ccffcc";
                }
    %>
    <tr onmouseover='this.style.backgroundColor="orange";this.style.cursor="hand"' onmouseout="this.style.backgroundColor='<%=color%>'" class="<%=estilo%>" >
        <td>
            <%=log.getIp()%>
        </td>
        <td>
            <%=log.getDate()%>
        </td>
        <td>
            <%=log.getUrl()%>
        </td>
        <td>
            <%
            
                out.println(log.getTexto());
            
            %>
        </td>
        
    </tr>
    
    <%}%>
    <tr><td>&nbsp;</td></tr>
</table>

<table>
    <tr>
        <%
        for(int i=0;i<numPagTotal;i++){
            if((i+1)==pagActual){
                out.print("<td>"+(i+1)+"</td>");
            }else{
                out.print("<td><a href='log_index.do?pagActual="+(i+1)+"'>"+(i+1)+"</a></td>");
            }
        }
        
        %>
        
    </tr>

    
</table>